package thread.novisibility;

/**
 * Created by IntelliJ IDEA.
 * User: liuliwei
 * Date: 2017-09-28
 * Time: 下午4:44
 * Description: ${description}
 */
public class NoVisibility {
    private static boolean ready;
    private static int number;

    private static class ReaderThread extends Thread {
        @Override
        public void run() {
            while (!ready) {
                Thread.yield();
                System.out.println(number);
            }
        }
    }

    public static void main(String[] args) {
        new ReaderThread().start();
        number =44;
        ready = true;

    }

    final void finalMethod() {

    }
}
